package io.shdxhl.simplerpc.code.config;

import org.I0Itec.zkclient.ZkClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Configuration
public class SimpleZkConfig {
    @Resource
    private SimpleConfiguration simpleConfiguration;

    @Bean
    public ZkClient zkClient() {
        ZkClient zkClient = new ZkClient(simpleConfiguration.getZkAddr(), simpleConfiguration.getZkTimeout());
        return zkClient;
    }
}
